import request from '@/utils/request'

/**
 *
 * 帖子相关接口
 *
 */

export function getPostList(params) {
  return request({
    url: '/posts',
    method: 'get',
    params
  })
}
export function getPostDetail(id) {
  return request({
    url: `/posts/${id}`,
    method: 'get'
  })
}
export function delPost(id) {
  return request({
    url: `/posts/${id}`,
    method: 'delete'
  })
}
export function changeStatus(id, onShelve) {
  return request({
    url: `/posts/${id}`,
    method: 'patch',
    data: { onShelve }
  })
}

